using UnityEngine;

public class EnemyDeadBringerIdle : EnemyState
{
    private EnemyDeadBringer enemy;
    private Player player;
    public EnemyDeadBringerIdle(Enemy _enemybase, EnemyStateMachine _stateMachine, string _animBoolName, EnemyDeadBringer _enemy) : base(_enemybase, _stateMachine, _animBoolName)
    {
        this.enemy = _enemy;
    }
    public override void Enter()
    {
        player = PlayerManger.instance.player;
        base.Enter();
        stateTimer = 2f;
    }

    public override void Exit()
    {
        base.Exit();

    }

    public override void Update()
    {

        base.Update();
        if (Vector2.Distance(player.transform.position, enemy.transform.position) > 7)
        {
            enemy.beginBattle = true;
        }
        if (Input.GetKeyDown(KeyCode.V))
        {
            stateMachine.ChangeState(enemy.deadBringerteleport);
        }

        // stateMachine.ChangeState(enemy.moveState);
        if (stateTimer < 0 && enemy.beginBattle)
        {
            stateMachine.ChangeState(enemy.deadBringerBattle);
        }

    }
}
